package net.godideas.giframework.global;

import android.app.Application;
import android.content.SharedPreferences;

public class BaseApp extends Application {
	
	protected static BaseApp mInstance;
	
	private SharedPreferences mSharedPreferences;
	
	/**
	 * Get instance of app
	 * @return
	 */
	public static synchronized BaseApp getInstance() {
        return mInstance;
    }
	
	/**
	 * Callback of create application
	 */
	@Override
    public void onCreate() {
        super.onCreate();
        mInstance = this;
        setSharedPreferences(getSharedPreferences(getPackageName() + "_preferences", MODE_PRIVATE));
    }

	/**
	 * @return the mSharedPreferences
	 */
	public SharedPreferences getSharedPreferences() {
		return mSharedPreferences;
	}

	/**
	 * @param mSharedPreferences the mSharedPreferences to set
	 */
	public void setSharedPreferences(SharedPreferences mSharedPreferences) {
		this.mSharedPreferences = mSharedPreferences;
	}
}
